﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using DailyDiet.Services;
using DailyDiet.Services.Impl;
using Moq;
using NUnit.Framework;

namespace DailyDietTest.Helper
{
    public class DietStorageServiceTestHelper {
        private static IDietStorageService _dietStorageService;
        public static async Task<IDietStorageService> getIntializedDietStorageService() {
            if (_dietStorageService != null) {
                return _dietStorageService;
            }
            var preferenceMocked = new Mock<IPreferenceStorage>();
            var mockedPreference = preferenceMocked.Object;
            _dietStorageService =
                new DietStorageService(mockedPreference);
            await _dietStorageService.InitializeAsync();
            return _dietStorageService;
        }
    }
}
